<template>
  <div class="my-table">
    <p>组件二</p>
    <MySunVue :count="count" />
  </div>
</template>

<script>
import eventbus from '../utils/eventbus'
import MySunVue from './MySun.vue'

export default {
  components: { MySunVue },
  props: {
    count: {
      type: Number
    }
  },
  data() {
    return {}
  },
  created() {
    // 监听一个事件
    eventbus.$on('UPDATE_COUNT', (e) => {
      console.log('我在兄弟组件里面监听：', e);
    })
  }
}
</script>

<style scoped>
.my-table {
  height: 100px;
  flex: 3;
  border: 1px solid red;
  padding: 15px;
}
</style>